package com.example.fourm.controller;

import com.example.fourm.exception.ApplicationException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @RequestMapping("/hello")
    public void testHello(){
        System.out.println("hello");
    }

    @RequestMapping("/exception")
    public void testException() throws Exception {
        throw new Exception("这是一个exception");
    }

    @RequestMapping("/applicatonException")
    public void testApplicatonException()  {
        throw new ApplicationException("这是一个applicatonException");
    }
}
